<?php
namespace app\manage\validate;

use think\Validate;

/**
 * 行为验证器
 * @package app\menus\validate
 * @author 
 */
class WorkConfig extends Validate
{
    //定义验证规则
    protected $rule = [
        'name|标题'  => 'require',
        'store_id|团队'   => 'require|number',
        'address|地址'   => 'require',
        'distance|距离'   => 'require',
        'status|状态'   => 'require',
    ];

    //定义验证提示
    protected $message = [
         'name.require' => '请输入栏目名称',
         'store_id.require' => '请选择门店',
         'store_id.number' => '门店数据格式不正确',
         'address.require' => '请选择地址',
         'distance.require' => '请选择距离',
         'status.require' => '请选择状态',
    ];

    //定义验证场景
    protected $scene = [
        //更新
        'add'  =>  ['name','store_id','address','distance','status'],
    ];
}
